<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Promise</title>
    </head>
    <body>
        <script type="module">
            import CP from './CP.js'
            let p1 = new CP((resolve, reject) => {
                resolve('成功')
            })
            let p2 = new CP((resolve, reject) => {
                // resolve('第二个promise')
                reject('失败')
            })
            CP.all([p1, p2]).then(
                result => {
                    console.log(result)
                },
                reason => {
                    console.log(reason)
                }
            )
        </script>
    </body>
</html>
